package org.grow.jssp.controller;

import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.servlet.ModelAndView;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.util.Arrays;
import java.util.List;

@Controller
public class AuthController {
    @GetMapping("/index")
    public ModelAndView doget(HttpServletRequest request, HttpServletResponse response){
        System.out.println("=========================");
        List<String> results= Arrays.asList("zhangsan","lisi","wangwu");
        String username ="Lucy";
        ModelAndView modelAndView=new ModelAndView();
        modelAndView.setViewName("login");
        modelAndView.addObject("friends",results);
        modelAndView.addObject("username",username);
        return modelAndView;
    }
}
